using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class KeyVal : GeneratedMessageLite<KeyVal, KeyVal.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<KeyVal, KeyVal.Builder>
		{
			private bool resultIsReadOnly;
			private KeyVal result;
			protected override KeyVal.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override KeyVal MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override KeyVal DefaultInstanceForType
			{
				get
				{
					return KeyVal.DefaultInstance;
				}
			}
			public uint Key
			{
				get
				{
					return this.result.Key;
				}
				set
				{
					this.SetKey(value);
				}
			}
			public uint Val
			{
				get
				{
					return this.result.Val;
				}
				set
				{
					this.SetVal(value);
				}
			}
			public Builder()
			{
				this.result = KeyVal.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(KeyVal cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private KeyVal PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					KeyVal other = this.result;
					this.result = new KeyVal();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override KeyVal.Builder Clear()
			{
				this.result = KeyVal.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override KeyVal.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new KeyVal.Builder(this.result);
				}
				return new KeyVal.Builder().MergeFrom(this.result);
			}
			public override KeyVal BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override KeyVal.Builder MergeFrom(IMessageLite other)
			{
				if (other is KeyVal)
				{
					return this.MergeFrom((KeyVal)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override KeyVal.Builder MergeFrom(KeyVal other)
			{
				return this;
			}
			public override KeyVal.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override KeyVal.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(KeyVal._keyValFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = KeyVal._keyValFieldTags[num2];
					}
					uint num3 = num;
					if (num3 == 0u)
					{
						throw InvalidProtocolBufferException.InvalidTag();
					}
					if (num3 != 8u)
					{
						if (num3 != 16u)
						{
							if (WireFormat.IsEndGroupTag(num))
							{
								return this;
							}
							this.ParseUnknownField(input, extensionRegistry, num, text);
						}
						else
						{
							this.result.hasVal = input.ReadUInt32(ref this.result.val_);
						}
					}
					else
					{
						this.result.hasKey = input.ReadUInt32(ref this.result.key_);
					}
				}
				return this;
			}
			public KeyVal.Builder SetKey(uint value)
			{
				this.PrepareBuilder();
				this.result.hasKey = true;
				this.result.key_ = value;
				return this;
			}
			public KeyVal.Builder ClearKey()
			{
				this.PrepareBuilder();
				this.result.hasKey = false;
				this.result.key_ = 0u;
				return this;
			}
			public KeyVal.Builder SetVal(uint value)
			{
				this.PrepareBuilder();
				this.result.hasVal = true;
				this.result.val_ = value;
				return this;
			}
			public KeyVal.Builder ClearVal()
			{
				this.PrepareBuilder();
				this.result.hasVal = false;
				this.result.val_ = 0u;
				return this;
			}
		}
		public const int KeyFieldNumber = 1;
		public const int ValFieldNumber = 2;
		private static readonly KeyVal defaultInstance;
		private static readonly string[] _keyValFieldNames;
		private static readonly uint[] _keyValFieldTags;
		private bool hasKey;
		private uint key_;
		private bool hasVal;
		private uint val_;
		private int memoizedSerializedSize = -1;
		public static KeyVal DefaultInstance
		{
			get
			{
				return KeyVal.defaultInstance;
			}
		}
		public override KeyVal DefaultInstanceForType
		{
			get
			{
				return KeyVal.DefaultInstance;
			}
		}
		protected override KeyVal ThisMessage
		{
			get
			{
				return this;
			}
		}
		public uint Key
		{
			get
			{
				return this.key_;
			}
		}
		public uint Val
		{
			get
			{
				return this.val_;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasKey && this.hasVal;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasKey)
				{
					num += CodedOutputStream.ComputeUInt32Size(1, this.Key);
				}
				if (this.hasVal)
				{
					num += CodedOutputStream.ComputeUInt32Size(2, this.Val);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private KeyVal()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] keyValFieldNames = KeyVal._keyValFieldNames;
			if (this.hasKey)
			{
				output.WriteUInt32(1, keyValFieldNames[0], this.Key);
			}
			if (this.hasVal)
			{
				output.WriteUInt32(2, keyValFieldNames[1], this.Val);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasKey)
			{
				num ^= this.key_.GetHashCode();
			}
			if (this.hasVal)
			{
				num ^= this.val_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object value)
		{
			KeyVal keyVal = value as KeyVal;
			return keyVal != null && (this.hasKey == keyVal.hasKey && (!this.hasKey || this.key_.Equals(keyVal.key_))) && (this.hasVal == keyVal.hasVal && (!this.hasVal || this.val_.Equals(keyVal.val_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<KeyVal, KeyVal.Builder>.PrintField("Key", this.hasKey, this.key_, writer);
			GeneratedMessageLite<KeyVal, KeyVal.Builder>.PrintField("Val", this.hasVal, this.val_, writer);
		}
		public static KeyVal ParseFrom(byte[] data)
		{
			return KeyVal.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private KeyVal MakeReadOnly()
		{
			return this;
		}
		public static KeyVal.Builder CreateBuilder()
		{
			return new KeyVal.Builder();
		}
		public override KeyVal.Builder ToBuilder()
		{
			return KeyVal.CreateBuilder(this);
		}
		public override KeyVal.Builder CreateBuilderForType()
		{
			return new KeyVal.Builder();
		}
		public static KeyVal.Builder CreateBuilder(KeyVal prototype)
		{
			return new KeyVal.Builder(prototype);
		}
		static KeyVal()
		{
			KeyVal.defaultInstance = new KeyVal().MakeReadOnly();
			KeyVal._keyValFieldNames = new string[]
			{
				"Key",
				"Val"
			};
			KeyVal._keyValFieldTags = new uint[]
			{
				8u,
				16u
			};
			object.ReferenceEquals(micromsg.Proto.KeyVal.Descriptor, null);
		}
	}
}
